package com.wangshouyu.mp.miniprogram;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.gson.annotations.SerializedName;

import java.io.Serializable;
import java.util.Objects;

/**
 * @author 王守钰
 * @date 2020年12月19日 06:49
 * @description 小程序
 */
public class Miniprogram implements Serializable {

    /**
     * 小程序appId
     */
    @SerializedName(value = "appid")
    @JsonProperty(value = "appid")
    @JSONField(name = "appid")
    private String appId;

    /**
     * 跳转页码
     */
    @SerializedName(value = "pagepath")
    @JsonProperty(value = "pagepath")
    @JSONField(name = "pagepath")
    private String pagePath;

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public String getPagePath() {
        return pagePath;
    }

    public void setPagePath(String pagePath) {
        this.pagePath = pagePath;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Miniprogram that = (Miniprogram) o;
        return Objects.equals(appId, that.appId) && Objects.equals(pagePath, that.pagePath);
    }

    @Override
    public int hashCode() {
        return Objects.hash(appId, pagePath);
    }

    @Override
    public String toString() {
        return "Miniprogram{" +
                "appId='" + appId + '\'' +
                ", pagePath='" + pagePath + '\'' +
                '}';
    }

    public Miniprogram(String appId, String pagePath) {
        this.appId = appId;
        this.pagePath = pagePath;
    }

    public Miniprogram() {
    }
}
